package com.chagee.channel.api.bo.lark;

import com.alibaba.fastjson.annotation.JSONField;
import com.chagee.channel.api.bo.FastJsonSerializer.ApprovalCommentSerializer;
import com.chagee.channel.api.bo.FastJsonSerializer.EpochMillSerializer;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 审核评论详情
 *
 * @author: chang.jiawei
 * @date: 2024/01/17
 */
@Data
@Accessors(chain = true)
public class ApprovalCommentListResponse implements Serializable {

    private static final long serialVersionUID = -4644567072689968421L;
    @ApiModelProperty("评论列表")
    private List<ApprovalCommentDetailVO> comments;

    /**
     * 评论信息
     *
     * @author: chang.jiawei
     * @date: 2024/01/17
     */
    @Data
    @Accessors(chain = true)
    public static class ApprovalCommentDetailVO implements Serializable {

        private static final long serialVersionUID = -2560420319698731484L;
        private Long id;

        @ApiModelProperty("评论内容")
        @JSONField(serializeUsing = ApprovalCommentSerializer.class)
        private ApprovalCommentContentDetailVO content;

        @ApiModelProperty("评论创建时间")
        @JSONField(serializeUsing = EpochMillSerializer.class)
        private LocalDateTime createTime;

        @ApiModelProperty("评论更新时间")
        @JSONField(serializeUsing = EpochMillSerializer.class)
        private LocalDateTime updateTime;

        @ApiModelProperty("是否删除，0:未删除，1:已删除")
        private Integer isDelete;

        @ApiModelProperty("评论的回复")
        private List<ApprovalCommentReplyDetailVO> replies;

        @ApiModelProperty("评论中艾特人信息")
        private List<ApprovalCommentAtDetailVO> atInfoList;

        @ApiModelProperty("评论创建人")
        private String commentator;

        @ApiModelProperty("附加字段")
        private String extra;
    }

    /**
     * 评论回复信息
     *
     * @author: chang.jiawei
     * @date: 2024/01/17
     */
    @Data
    @Accessors(chain = true)
    public static class ApprovalCommentReplyDetailVO implements Serializable {

        private static final long serialVersionUID = -2560420319698731484L;
        private Long id;

        @ApiModelProperty("评论内容")
        @JSONField(serializeUsing = ApprovalCommentSerializer.class)
        private ApprovalCommentContentDetailVO content;

        @ApiModelProperty("评论创建时间")
        @JSONField(serializeUsing = EpochMillSerializer.class)
        private LocalDateTime createTime;

        @ApiModelProperty("评论更新时间")
        @JSONField(serializeUsing = EpochMillSerializer.class)
        private LocalDateTime updateTime;

        @ApiModelProperty("是否删除，0:未删除，1:已删除")
        private Integer isDelete;

        @ApiModelProperty("评论中艾特人信息")
        private List<ApprovalCommentAtDetailVO> atInfoList;

        @ApiModelProperty("评论创建人")
        private String commentator;

        @ApiModelProperty("附加字段")
        private String extra;

    }

    /**
     * 评论回复@信息
     *
     * @author: chang.jiawei
     * @date: 2024/01/17
     */
    @Data
    @Accessors(chain = true)
    public static class ApprovalCommentAtDetailVO implements Serializable {

        private static final long serialVersionUID = 2894033065845732057L;
        @ApiModelProperty("被艾特人的ID")
        private String userId;

        @ApiModelProperty("被艾特人的姓名")
        private String name;

        @ApiModelProperty("被艾特人在评论中的位置，从0开始")
        private String offset;
    }

    /**
     * 评论内容
     *
     * @author: chang.jiawei
     * @date: 2024/01/17
     */
    @Data
    @Accessors(chain = true)
    public static class ApprovalCommentContentDetailVO implements Serializable {

        private static final long serialVersionUID = 2894033065845732057L;
        @ApiModelProperty("文本")
        private String text;

        @ApiModelProperty("附件")
        private List<ApprovalCommentContentFileVO> files;
    }

    /**
     * 评论文件
     *
     * @author: chang.jiawei
     * @date: 2024/01/17
     */
    @Data
    @Accessors(chain = true)
    public static class ApprovalCommentContentFileVO implements Serializable {

        private static final long serialVersionUID = -1051663406475828764L;
        private String url;

        private String thumbnailURL;

        private Long fileSize;

        private String title;

        @ApiModelProperty("attachment/image")
        private String type;
    }
}
